import service from '@/utils/request'

export const useUserListApi = (data: any) => {
	return service.post('/api/strator/list', data)
}
export const useUserInfoApi = (id?: number) => {
	return service.post('/api/strator/detail', {id})
}
export const useUserInfoToken = (id?: number) => {
	return service.post('/api/strator/info', {id})
}

export const updatePasswordApi = (data: any) => {
	return service.post('/api/strator/reset/own/password', data)
}
export const updateUserPasswordApi = (data: any) => {
	return service.post('/api/strator/password/modify', data)
}

export const useUserAddApi = (data: any) => {
	return service.post(data.id ? '/api/strator/modify' : '/api/strator/add', data)
}

export const useUserApi = (id: number) => {
	return service.post('/api/strator/detail', {id})
}
export const setUserPositionApi = (data: any) => {
	return service.post('/api/strator/auth/position', data)
}
export const getUserPositionApi = (id: any) => {
	return service.post('/api/strator/auth/own/position/ids', {strator_id: id})
}
export const setUserPermissionApi = (data: any) => {
    return service.post('/api/strator/auth/permission', data)
}
export const getUserPermissionApi = (id: any) => {
    return service.post('/api/strator/auth/direct/permission/ids', {strator_id: id})
}
export const getPostPermissionApi = (id: any) => {
    return service.post('/api/strator/auth/position/permission', {strator_id: id})
}

